<template>
  <div class="page-box">
    <el-row class="page-box-top">
      <el-col :span="18" class="page-box-form">
        <slot name="form"></slot>
      </el-col>
      <el-col :span="6" class="page-box-r">
        <el-card class="box-card">
          <div slot="header" class="header-card">
            <span class="header-card-title">审批意见</span>
          </div>
          <div class="con-card">
            <div>
              <el-input type="textarea" :rows="4" placeholder="请输入内容">
              </el-input>
            </div>
            <div class="yj-sty">
              <!-- <el-select placeholder="更过操作" style="width: 100px;margin-right: 16px;" size="mini"> -->

              <!-- </el-select> -->
              <el-button size="mini">驳回</el-button>
              <el-button type="primary" size="mini">通过</el-button>
            </div>
          </div>
        </el-card>
        <el-card class="box-card">
          <div slot="header" class="header-card">
            <span class="header-card-title">申请记录</span>
          </div>
        </el-card>
        <el-card class="box-card">
          <div slot="header" class="header-card">
            <span class="header-card-title">审批</span>
          </div>
        </el-card>
        <el-card class="box-card">
          <div slot="header" class="header-card">
            <span class="header-card-title">审批批复意见</span>
          </div>
        </el-card>
      </el-col>
    </el-row>
    <div class="page-box-d">
      <div style="text-align: center; margin: 20px 0">
        <el-button size="mini" @click="closeSelectedTag">{{butShow?'取消':'关闭'}}</el-button>
        <!-- 保存操作 -->
        <el-button type="primary" size="mini" @click="submit" v-if="butShow">提交</el-button>
      </div>
    </div>
  </div>
</template>

<script>
export default {

  model: {
    prop: 'details',
    event: 'changeDetails'
  },

  props: ['details', 'butShow'],

  data() {
    return {
      value: "",
      formBus: {},

    }

  },


  watch: {
    details: {
      handler(val, oldVal) {
        if (!val) return;

        this.formBus = val;
      },
      // 深度观察监听
      deep: true,
      immediate: true,
    },
  },
  computed: {
    visitedViews() {
      return this.$store.state.tagsView.visitedViews;
    },
  },
  created() { },
  mounted() {
    // 获取详情
  },
  methods: {
    // 取消关闭页面
    closeSelectedTag() {
      this.$emit("closeSelectedTag", this.$route);
    },
    // 表单数据(目前只做保存)
    submit() {
      // type 状态判断提交
      this.$emit("submitOn");
    },
  },
};
</script>

<style scoped lang="scss">
.page-box {
  padding: 16px;
  display: flex;
  flex-direction: column;

  .page-box-top {
    display: flex;

    .page-box-form {
      flex: 1;
    }

    .page-box-r {
      // width: 360px;
      padding-left: 16px;
    }

    // .page-box-r {}
  }

  // .page-box-d {
  //   // height: 60px;

  // }

  .box-card {
    font-size: 14px;
    margin-bottom: 16px;

    .con-card {
      .yj-sty {
        margin-top: 20px;
      }
    }

    ::v-deep .el-card__header {
      padding: 0;
      height: 48px;
      margin: 0 14px;
      display: flex;
      align-items: center;

      .header-card {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex: 1;

        .header-card-title {
          font-size: 16px;
          font-weight: 500;
          color: #333333;
        }
      }
    }

    ::v-deep .el-card__body {
      padding: 10px 14px;
    }
  }
}
</style>
